<?php
include_once("../modules/checkA.php");
include_once("../../config.php"); 
$plate=select_one_line_all_items($table_Prefix."plate","mid = 'finance'");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid']; 
?>
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include_once(ROOT_PATH_.'/controlbase/modules/head.php'); ?>
</head>

<body>

 
 

<?php
//接收需要修改的数据的id
$new_nid = addslashes($_REQUEST['nid']);

//传递过来的页面信息。返回的时候，会根据这些信息返回原来的页面
$nowpageid      = addslashes($_REQUEST['nowpageid']);
$sortby         = addslashes($_REQUEST['sortby']);
$term_nid       = addslashes($_REQUEST['term_nid']);
?>


<?

$new_name         = addslashes($_REQUEST['name']);
$new_principal         = addslashes($_REQUEST['principal']);
$new_departmentid = addslashes($_REQUEST['departmentid']);
$new_cost         = addslashes($_REQUEST['cost']);
$new_applydate    = addslashes($_REQUEST['applydate']);
$new_classify     = addslashes($_REQUEST['classify']);
$new_remark       = addslashes($_REQUEST['remark']);
$ip               = $_SERVER["REMOTE_ADDR"];
$new_authur       = $_SESSION['nid'];

 
//设置需要搜索的表格的前缀后缀
$table_Suffix = $plate['table_Suffix'];
$table        = $table_Prefix . $table_Suffix;

$sql = "update $table SET
name= '$new_name',
principal= '$new_principal',
departmentid= '$new_departmentid',
cost= '$new_cost',
applydate= '$new_applydate',
classify= '$new_classify',
authur= '$new_authur',
ip= '$ip',
remark= '$new_remark'

where nid=$new_nid";
$query = mysql_query($sql) or die ('更新detail表product数据失败');
mysql_close($con);

?>





<?

$nowpageid = $_GET["nowpageid"];
if($nowpageid==1){
    $url = "detail-list.php?nav-itemed=finance";
}
else{
    $url = "detail-list.php?nowpageid=".$nowpageid."&sortby=nid&nid=&sys_part=finance&nav-itemed=finance";
}
?>



<script type="text/javascript">
    alert("输入信息已保存，点击确认返回继续操作.");
    document.location.href = "<?echo $url?>";

</script>


</body>